package com.mobile.check.activitys;

import android.app.Activity;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;


import butterknife.BindView;
import cn.droidlover.xdroidmvp.cache.SharedPref;
import cn.droidlover.xdroidmvp.kit.NToast;
import cn.droidlover.xdroidmvp.mvp.XActivity;
import com.mobile.check.app.R;
import com.mobile.check.present.BasePresent;
import com.mobile.check.views.MyEditText;

/**
 * 类名: InputEditActivity
 * 作者: 李学伟
 * 日期: 2020年10月14日 18:37
 * 描述:
 */
public class QuanxianEditActivity extends XActivity<BasePresent> {
    @BindView(R.id.qunxianEt)
    MyEditText qunxianEt;

    int type;

    @Override
    public void initView() {
        super.initView();
        titleTv.setText("单元复制权限");
        rightTv.setText("确定");
        rightTv.setVisibility(View.VISIBLE);
    }

    @Override
    public void onRightClick(View view) {
        super.onRightClick(view);
        String quanxian = qunxianEt.getValue();
        if (TextUtils.equals("00000000", quanxian)) {
            SharedPref.getInstance(this).putBoolean("quanxian",true);
            NToast.showToast(this, "开启成功", 1);
            setResult(Activity.RESULT_OK);
            finish();
        } else {
            NToast.showToast(this, "密码错误", 1);
        }
    }

    @Override
    public void getDataFromServer() {

    }

    @Override
    public int getContentViewId() {
        return R.layout.activity_quanxian;
    }

    @Override
    public void getIntentData() {
    }

    @Override
    public BasePresent newP() {
        return new BasePresent();
    }


    public static void lunch(Activity act) {
        Intent intent = new Intent(act, QuanxianEditActivity.class);
        act.startActivity(intent);
    }

    @Override
    public boolean isNotWorkConnect() {
        return false;
    }
}
